m=3
n=7

m1=2
n1=5
while n1<=1000000:
    m1=m1+m
    n1=n1+n
print m1,n1
